import React, {Component, Children} from 'react'
import {routerShape} from 'react-router';
import {inject, observer} from 'mobx-react';
import {observable, action, toJS} from 'mobx';

import {Tooltip, Tabs, Modal, Button,Spin, Table, message, Menu,Icon} from 'antd'
const TabPane = Tabs.TabPane
const Confirm = Modal.confirm;

import WeaCircleImage from "../../../Component/wea-circle-image"
import WeaRate from "../../../Component/wea-rate"

import {WeaDialog, WeaRichText, WeaDropdown, WeaBrowser, WeaHelpfulTip} from 'ecCom'
const { ButtonSelect } = WeaDropdown;

import CommentList from "./CommentList"
import WorkRecordList from "./WorkRecordList"
import CommentBar from "./CommentBar"
import WeiboBar from "./WeiboBar"
import CubeLayout from "../../../../../govern/components/E9/cubeLayout";
import AgreeContainer from './AgreeContainer'

import ComVar from "../ComVar"
const MenuItem = Menu.Item;
const {TaskType, Moods, PublicRangeType, ComeFrom, WeiboType} = ComVar

import WeaUtils from "../../../Component/wea-utils"

const {DateFormat} = WeaUtils

import WeaAnnularIcon from "../../../Component/wea-annular-icon"
import WeaBlogDict from '../../../Component/wea-blog-dict';

const innerHref = WeaBlogDict.href;

import Mood from "./Mood"

import * as Util from '../../../../util/index'
import WeiboMapDialog from './WeiboMapDialog';
import Dict from '../../../Component/wea-blog-dict';

import {WeaLocaleProvider} from "ecCom";
import {transfStr} from "../../../../util/index";


const getLabel = WeaLocaleProvider.getLabel;

const mirror = Dict.bottomBarMirror;
const Authority = {
    one: 'one',
    many: 'many',
    all: 'all'
}


@inject('blogMyBlog')
@observer

class WeiboContainer extends Component {
    static contextTypes = {
        router: routerShape
    }

    constructor(props) {
        super(props)
        this.state = {
            showWorkRecord: false,
            showScore: false,
            isSpread:0,
            modalPublicViewVisible: false,
            commenting: false,
            authType: PublicRangeType.public,
            authRange: [],
            editing: false,
            isOk:false,
            showEdit: false,
            showComment: false,
            isRemind: false,
            noteworkdate:'',
            oneecmespinning:true,
            Card:{},
            CubeLayoutParames:{},
            partids:undefined,
            wearichtextstatus:"",
            templateD:"",
            viewShareType:'1',
            shareValue:'',
            shareTitle:"",
            sreplaceDatas:[]
        }
        this.onTempletChange = this.onTempletChange.bind(this);
    }

    getCardStorefun = (store)=>{
        this.setState({Card:store})
    }



    changeShowViewShare = (e) => {
        e.nativeEvent.stopImmediatePropagation();
    const {workdate , blogId} = this.props;
    let vid = "";
    let shareDivCss = "";
        if (blogId) {
            vid = '#shareDiv_'+blogId;
        } else {
            vid = '#shareDiv_'+workdate;
        }

        shareDivCss =  jQuery(vid).css("display")
        if(shareDivCss=='block'){
            jQuery(vid).css("display","none")
        }else{
            jQuery(vid).css("display","block")
        }
    }

    changeviewShareType = (val,ids) => {

        const {changeReplaceDatas} = this.props.blogMyBlog;
        changeReplaceDatas([])

        const {workdate , blogId} = this.props;
        let vid = "";
        let shareDivCss = "";

        if (blogId) {
            vid = '#shareDiv_'+blogId;
        } else {
            vid = '#shareDiv_'+workdate;
        }

        if(ids!=undefined&&ids!=''){
            shareDivCss =  jQuery(vid).css("display")
            jQuery(vid).css("display","none")
            this.setState({viewShareType:val,shareValue:ids,sreplaceDatas:[]})
        }else if(ids!=undefined&&ids==''){
            this.setState({viewShareType:1,sreplaceDatas:[]})
        }else {
            this.setState({viewShareType:val,sreplaceDatas:[]})
        }
    }

    changeviewShareTypeDatas = (val,ids,datas) => {
        const {changeReplaceDatas} = this.props.blogMyBlog;
        changeReplaceDatas([])
        const {workdate , blogId} = this.props;
        let vid = "";
        let shareDivCss = "";

        if (blogId) {
            vid = '#shareDiv_'+blogId;
        } else {
            vid = '#shareDiv_'+workdate;
        }

        shareDivCss =  jQuery(vid).css("display")
        jQuery(vid).css("display","none")
        if(ids!=undefined&&ids!=''){
            this.setState({viewShareType:val,shareValue:ids,sreplaceDatas:datas})
        }else if(ids!=undefined&&ids==''){
            this.setState({viewShareType:1})
        }else {
            this.setState({viewShareType:val})
        }
    }


    changeviewShareType4 = (ids, names, datas) => {
        this.changeviewShareTypeDatas(4,ids,datas);
    }


    changeviewShareType3 = (ids, names, datas) => {
        this.changeviewShareTypeDatas(3,ids,datas);
    }

    changeviewShareType2 = () => {
        this.changeviewShareType(2);
    }

    changeviewShareType1 = () => {
        this.changeviewShareType(1);
    }

    componentDidMount() {
        let dom = ReactDOM.findDOMNode(this);
        WeaUtils.imgZoom(dom, ".wea-mbwc-normal");
        let {partid,isSpread,shareType,shareValue} = this.props;
        if(isSpread==1){
            this.setState({showWorkRecord:true})
        }



        this.setState({partids:partid,viewShareType:shareType,shareValue:shareValue})
    }



    componentDidUpdate() {
        let dom = ReactDOM.findDOMNode(this);
        WeaUtils.imgZoom(dom, ".wea-mbwc-normal");
    }


    componentWillUnmount() {

    }


    onEditRichClick = () => {

        let {getBlogWeiConEcmeInfo,getInfoShare} = this.props.blogMyBlog
        const {ismerge,ecmeEditButtons} = this.props;

        if(this.props.blogId){
            getInfoShare(this.props.blogId);
        }

        const data = ecmeEditButtons[0];
        const partid = data.partid;
        if(parseInt(partid)!=0){
            getBlogWeiConEcmeInfo({blogid:data.id,partid:data.partid},(result) => {
                this.setState({CubeLayoutParames:result.data})
            });
            this.setState({showEdit: true, editing: true,noteworkdate:''})
        }else{
            this.setState({showEdit: true, editing: true,noteworkdate:''})
        }
        if(!(window.location.href.indexOf('/user/')>0)){
            let {changeEdit} = this.props.blogMyBlog;
            changeEdit( {bqshowEdit: true, bqediting: true});
        }
    }


    onBuJiaoClick = () => {
        const {getBlogWeiConEcmeInfo} = this.props.blogMyBlog
        const {blogId,partid} = this.props;
        if(partid>0){
            getBlogWeiConEcmeInfo({blogid:this.props.blogId,partid:partid},(result) => {
                this.setState({CubeLayoutParames:result.data});
            });
            this.setState({showEdit: true, editing: true,noteworkdate:''})
        }else{
            this.setState({showEdit: true, editing: true,noteworkdate:''})
        }
        if(!(window.location.href.indexOf('/user/')>0)){
            let {changeEdit} = this.props.blogMyBlog;
            changeEdit( {bqshowEdit: true, bqediting: true});
        }
    }

    onEditClick = (ckeId, content) => {
        const {getBlogWeiConEcmeInfo,getInfoShare} = this.props.blogMyBlog
        const {partid} = this.props;

        if(this.props.blogId){
            getInfoShare(this.props.blogId);
        }


        if(partid>0){
            getBlogWeiConEcmeInfo({blogid:this.props.blogId,partid:partid},(result) => {
                this.setState({CubeLayoutParames:result.data});
            });
            this.setState({showEdit: true, editing: true,noteworkdate:''})
        }else{
            this.setState({showEdit: true, editing: true,noteworkdate:''})
        }

        if(!(window.location.href.indexOf('/user/')>0)){
            let {changeEdit} = this.props.blogMyBlog;
            changeEdit( {bqshowEdit: true, bqediting: true});
        }
    }

    publishBlogEcme = (ckeId) => {
        let {setDisabled,saveBlogEcmeInfo,updateBlogEcmeinfo,partid} = this.props.blogMyBlog;
        let {CubeLayoutParames,Card} =this.state;
        let {ismerge,ecmeEditButtons,blogId,workdate} = this.props;

        if(ecmeEditButtons.length==1){
            blogId=ecmeEditButtons[0].id
            partid=ecmeEditButtons[0].partid;
        }

        if(this.state.partids!=undefined){
            partid = this.state.partids;
        }


        let cubeLayoutParame= CubeLayoutParames;
        let ecmeExtend = {};
        if (Object.keys(cubeLayoutParame).length > 0) {//建模布局保存方法
            const { ecmeDoSubmit } = Card.Actions;
            ecmeDoSubmit().then((data) => {
                ecmeExtend= data.JSONStr.extendDatas;
                typeof setDisabled === 'function' && setDisabled(true);
                let params = {
                    ecmeExtend: JSON.stringify(ecmeExtend),
                    appItemId:  (this.refs[ckeId + '_ecme_mood'] && this.refs[ckeId + '_ecme_mood'].getValue()) || "1",
                    comefrom: ComeFrom.pc,
                    content: "none",
                    workdate: workdate,
                    blogId:blogId,
                    partid:partid,
                    shareType:this.state.viewShareType,
                    shareValue:this.state.shareValue,
                }
                if(params.blogId==undefined){
                    saveBlogEcmeInfo(
                        params,
                        result => {
                            if (result.status) {
                                this.setState({editing: false, showEdit: false,noteworkdate:'',CubeLayoutParames:{},oneecmespinning:true})
                                setTimeout(() => {
                                    setDisabled(false)
                                }, 1000)
                            }
                        }
                    )
                }else{
                    updateBlogEcmeinfo(
                        params,
                        result => {
                            if (result.status) {
                                this.setState({editing: false, showEdit: false,noteworkdate:'',CubeLayoutParames:{},oneecmespinning:true})
                                setTimeout(() => {
                                    setDisabled(false)
                                }, 1000)
                            }
                        }
                    )
                }

            })
        }
    }




    duoBlogEcmeEditOpen = (id,partid) => {
        let {changeEcmeVisDiaLog,getBlogEcmeInfo,changeRichTextVisDiaLog} = this.props.blogMyBlog;
        let workdate = DateFormat(this.props.workdate, "yyyy-MM-dd");


        if(partid>0){
            changeEcmeVisDiaLog(true,workdate,id);
            getBlogEcmeInfo({blogid:id,partid:partid});
        }else{
            getBlogEcmeInfo({blogid:id,partid:partid});
            changeRichTextVisDiaLog(true,workdate,id);

        }


    }


    //打开建模 编辑窗口
    blogEcmeInfoOpen = () => {
        let {changeEcmeVisDiaLog,getBlogEcmeInfo,ecmeEditDialog,defaultCubeLayoutParame} = this.props.blogMyBlog;
        const {partid} = this.props;
        let workdate = DateFormat(this.props.workdate, "yyyy-MM-dd")
        changeEcmeVisDiaLog(true,workdate,this.props.blogId);
        if(partid==0){
            getBlogEcmeInfo({blogid:this.props.blogId,partid:defaultCubeLayoutParame.partid});
        }else{
            getBlogEcmeInfo({blogid:this.props.blogId,partid:partid});
        }

    }

    blognottt = () =>{
        let {changeBqVisDiaLog,getNote} = this.props.blogMyBlog
        let workdate = DateFormat(this.props.workdate, "yyyy-MM-dd")
         changeBqVisDiaLog(true,workdate);
        this.setState({noteworkdate:workdate,showEdit:true});
        getNote();
    }


    changeShowViewShareDia = () => {
        const {getInfoShare} = this.props.blogMyBlog;
        getInfoShare(this.props.blogId);
    }


    initCallBack=()=>{
       this.setState({oneecmespinning:false})
    }

    componentWillReceiveProps(nextProps){
        nextProps.shareType!==this.props.shareType&&this.setState({viewShareType:nextProps.shareType});
    }



    onClickOpenShare = () => {
        const {blogId} = this.props;
        const {changeShareUserListVisible} = this.props.blogMyBlog;
        changeShareUserListVisible(true,blogId);
    }

    render() {
        let {showScore,showWorkRecord, commenting, editing, CubeLayoutParames,oneecmespinning, showEdit, showComment,noteworkdate} = this.state,
            {
                _key, blogMyBlog,ecmeEditButtons,
                children, blogId, blogType, isLast, currentUser = {},  dateLocal = "", user, type, workdate,
                mood, authority, isAgree, score, content, defaultTemplate, agrees, replenishTitle,
                comments = [],isShowBdShare,
                isCanReplenish, isShowLog, isCanEdit,isCanCom, isUnSumitRemind, isCanZan, isMeCanScored,
                isHasLocation, isManagerScore, isShowReadOrUnread, isReaded, weiboCKEditorConfig,
                hasEditor, hasImage, hasScroll,wworkRecords,isPermissions,specialStatus,oneSubmit,shareType,shareValue,
           partid } = this.props


        content || (content = defaultTemplate.tempContent);

        if(this.state.templateD){
            content = this.state.templateD;
        }

        let {bqshowEdit,disabled,replaceDatas}=this.props.blogMyBlog;


        if(this.state.sreplaceDatas.length!=0){
            replaceDatas = this.state.sreplaceDatas;
        }




        let cubeFlags  = Object.keys(toJS(CubeLayoutParames)).length > 0;


        let cubeLayoutParame = CubeLayoutParames;

        if(noteworkdate==this.props.workdate){

            editing=toJS(bqshowEdit).bqediting;
            showEdit=toJS(bqshowEdit).bqshowEdit;
        }



        let showTT = '';

        if(shareValue!=''){
            let shareTiarr = shareValue.split(',');

            if(shareType==3){
                showTT = shareTiarr.length-2+getLabel(525182,'人可见')
            }else{
                showTT = shareTiarr.length-2+getLabel(525183,'人不可见')
            }
        }



        const workRecords =wworkRecords;

        const typeIcon = {
            current: {
                name: "current",
                icon: "icon-blog-solid",
                color: "#32a8ff",
                tip: "编辑中 "
            },
            normal: {
                name: "normal",
                icon: "icon-blog-Submit",
                color: "#75bf26",
                tip: "提交于 "
            },
            expired: {
                name: "expired",
                icon: "icon-blog-delay",
                color: "#f5b400",
                tip: "补交于 "
            },
            white: {
                name: "white",
                icon: "icon-blog-Uncommitted",
                color: "#ff3044",
                tip: "未提交 "
            }
        }


        const publics = []
        for (let i = 0; i < 100; i++) {
            publics.push({
                type: `部门${i}`,
                content: `需求分析${i}`,
                level: `${i} - 100`
            })
        }

        this.ckeId = '';
        let ckeId = "" ;
        let shareiid = "";
        if (blogType && workdate && user.id) {
            if (blogId) {
                ckeId = `wea_ckeditor_weibo_${blogType}_${workdate}_${user.id}_${blogId || ""}`;
                shareiid = 'shareDiv_'+blogId;
            } else {
                ckeId = `wea_ckeditor_weibo_${blogType}_${workdate}_${user.id}_anruo_${_key}`;
                shareiid = 'shareDiv_'+workdate;
            }
            this.ckeId = ckeId;
        }

        //暂时接入过来 zxt
        let bottomBarConfig = [];


        if(!(window.location.href.indexOf("/user/")>0)) {
            bottomBarConfig.push({
                name: 'Component',
                show: <div className="wea-cb-item" onClick={this.blognottt}>
                    <span className='wea-cbi-icon icon-coms02-Send-it-to-Weibo'/>
                    <span className="wea-cbi-text">{getLabel(33305,'便签')}</span>
                </div>
            })
        }



        weiboCKEditorConfig && weiboCKEditorConfig.map((cg,key) => {
            cg.name === 'selects' && bottomBarConfig.push({
                name: 'Component',
                show: <Mood ecId={`${this && this.props && this.props.ecId || ''}_Mood@e0z422${key}`} ref={ckeId + '_mood'}  mooddata={mood} onSelect={mood => {
                }}/>
            })

            cg.name === 'dialogs' && cg.items.map(item => {
                let obj = {
                    isBlog: true,
                    name: 'Browser',
                    show: <div className="wea-cb-item">
                        <span className={`wea-cbi-icon ${mirror[item].icon}`}/>
                        <span className="wea-cbi-text">{mirror[item].nameFunc()}</span>
                    </div>,
                    type: mirror[item].type,
                    title: mirror[item].nameFunc(),
                    isSingle: item === 'Templet',
                };
                if (item === 'Templet') obj.onToolsChange = this.onTempletChange
                bottomBarConfig.push(obj);
            })
            cg.name === 'uploads' && cg.items.map(item => {
                bottomBarConfig.push({
                    isBlog: true,
                    name: 'Upload',
                    type: 'file',
                    show: <div className="wea-cb-item">
                        <span className='wea-cbi-icon icon-blog-Enclosure'/>
                        <span className="wea-cbi-text">{getLabel(156, "附件")}</span>
                    </div>,
                    uploadId: 'webo_edit',
                    uploadUrl: `${item.Attachment.uploadUrl}`,
                    category: item.Attachment.position,
                    maxUploadSize: item.Attachment.maxSize,
                    style: {display: "inline-block"}
                })
            })
        })
        let {isOk,viewShareType} = this.state;

        let bd1Color = {'background-color':"white"};
        let bd2Color = {'background-color':"white"};
        let bd3Color = {'background-color':"white"};
        let bd4Color = {'background-color':"white","border-bottom":"1px solid #d7d7d7"};


        viewShareType = viewShareType+"";

        let repalceDatas3 = [];
        let repalceDatas4 = [];
        let hideStyle={width: 25,left: -12}
        let viewShare = getLabel(2161,'公开');
        if(viewShareType=='1'){
            bd1Color = {'background-color':"#ecf7fe"};
        }else if(viewShareType=='2'){
            viewShare = getLabel(83281,'私密') ;
            bd2Color = {'background-color':"#ecf7fe"};
        }else if(viewShareType=='3'){
            hideStyle={width: 50,left: -37}
            repalceDatas3 = replaceDatas;
            viewShare = getLabel(521692,'谁可以看') ;
            bd3Color = {'background-color':"#ecf7fe"};
        }else if(viewShareType=='4'){
            hideStyle={width: 50,left: -37}
            repalceDatas4 = replaceDatas;
            viewShare = getLabel(525176,'不给谁看') ;
            bd4Color = {'background-color':"#ecf7fe","border-bottom":"1px solid #d7d7d7"};
        }


        let comsdownST = {position: "relative",'display':'none'};

        if( isShowBdShare ==1){
            comsdownST = {position: "relative"};
        }


        let bottomBarRight = {
            width: 310,
            Component: [
                <div><span className="wea-rich-text-toolbar-bottom-item" style={comsdownST}>
                    <div className="shareButtonTitle"  title={viewShare} style={hideStyle}>{viewShare}</div><span className='icon-coms-down' onClick={this.changeShowViewShare} style={{"font-size": "xx-small", "color":'#989a9c','margin-left':'10px'}}>
                    <WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@4dkvof@sharehelptip`}
                        width =  {260} //如果要自定义宽度，在这里设置
                        title={getLabel(525177,'微博没有真正意义上的"私密",上级和后端指定共享人为固定共享,不可修改."谁可以看"和"不给谁看"均为排除固定共享之后的筛选.') }
                        isCenter={true}
                        style={{'margin-left': '10px', 'top': '2px', 'position': 'relative'}}
                        placement = 'bottom'
                    /></span>
                     <div className='viewShareAll'  id={shareiid} >
                         <div className='viewshareitem'  style={bd1Color} onClick={this.changeviewShareType1}>
                             <div className='viewshareitemicon'>
                               {viewShareType=='1'?<i className="icon-coms-Upload-successfully-o"/>:<i className="icon-coms-Upload-successfully-o" style={{"visibility": "hidden"}}/>}
                             </div>
                              <div className='viewshareiteminfo'>
                                  <div  className='viewshareitemtitle' style={{"font-size":"14px"}}>{getLabel(2161,'公开') }</div>
                                  <div  className='viewshareitemtitleinfo' style={{'color':"#838181","font-size":"12px"}}>{getLabel(525178,'所有共享人可见') }</div>
                              </div>
                         </div>
              <div className='viewshareitem' style={bd2Color}  onClick={this.changeviewShareType2}>
                   <div className='viewshareitemicon'>
                       {viewShareType=='2'?<i className="icon-coms-Upload-successfully-o"/>:<i className="icon-coms-Upload-successfully-o" style={{"visibility": "hidden"}}/>}
                   </div>
                              <div className='viewshareiteminfo'>
                                  <div className='viewshareitemtitle' style={{"font-size":"14px"}}>{getLabel(83281,'私密') }</div>
                                  <div className='viewshareitemtitleinfo' style={{'color':"#838181","font-size":"12px"}}>{getLabel(525179,'仅自己和固定共享人可见') }</div>
                              </div>
              </div>
              <div className='viewshareitem' style={bd3Color} >
                  <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@wtnl4c@blogAttentionUsers`}
                              type="17"
                           
                              browserModalProps ={{parentClassName:"viewShareDialog"}}
                              textDecoration={true}
                              dataParams={{
                                  bdShare:"1"
                              }}
                              completeParams={{
                                  bdShare:"1"
                              }}
                              conditionDataParams={{
                                  bdShare:"1"
                              }}
                      viewAttr={3}
                      inputStyle={{ width: 232 }}
                      onChange={this.changeviewShareType3}
                      customized={true}
                      isSingle={false}
                      replaceDatas={repalceDatas3}
                      title={getLabel(521692,'谁可以看')}
                      icon="icon-coms-blog"
                  >
                    <div className='viewshareitemicon'>
                        {viewShareType=='3'?<i className="icon-coms-Upload-successfully-o"/>:<i className="icon-coms-Upload-successfully-o" style={{"visibility": "hidden"}}/>}
                    </div>
                    <div className='viewshareiteminfobrw'>
                       <div className='viewshareitemtitle' style={{"font-size":"14px"}}>{getLabel(521692,'谁可以看') }</div>
                       <div className='viewshareitemtitleinfo' style={{'color':"#838181","font-size":"12px"}}>{getLabel(525180,'指定共享人可见') }</div>
                    </div>
                  </WeaBrowser>
              </div>
              <div className='viewshareitem' style={bd4Color} >
                  <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@4j48wf@blogAttentionUsers`}
                              type="17"
                              browserModalProps ={{parentClassName:"viewShareDialog"}}
                              textDecoration={true}
                              dataParams={{
                                  bdShare:"1"
                              }}
                              completeParams={{
                                  bdShare:"1"
                              }}
                              conditionDataParams={{
                                  bdShare:"1"
                              }}
                      viewAttr={3}
                      inputStyle={{ width: 232 }}
                      onChange={this.changeviewShareType4}
                      customized={true}
                      isSingle={false}
                      title={getLabel(525176,'不给谁看')}
                      icon="icon-coms-blog"
                      replaceDatas={repalceDatas4}
                  >
                         <div className='viewshareitemicon'>
                             {viewShareType=='4'?<i className="icon-coms-Upload-successfully-o"/>:<i className="icon-coms-Upload-successfully-o" style={{"visibility": "hidden"}}/>}
                         </div>
                            <div className='viewshareiteminfobrw'>
                               <div className='viewshareitemtitle' style={{ "font-size":"14px"}}>{getLabel(525176,'不给谁看') }</div>
                               <div className='viewshareitemtitleinfo' style={{'color':"#838181","font-size":"12px"}}>{getLabel(525181,'指定共享人不可见') }</div>
                            </div>
                  </WeaBrowser>
              </div>
          </div>
                 </span>
                <span className="wea-rich-text-toolbar-bottom-item" style={{position: "relative", float: 'right',right: 50}}>
				<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@y5zhen@publishWeibo`} disabled={isOk} className="wea-button-release" onClick={this.publishWeibo.bind(this, ckeId)}>
					<span><span className="icon-coms-Release"/><span>{getLabel(114, "发布")}</span></span>
				</Button>
				<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@rjzg71@cancelWeibo`} onClick={this.cancelWeibo.bind(this,ckeId + "_edit")}
                        style={{marginLeft: '8px'}}>{getLabel(31129, "取消")}</Button>
			    </span>
                </div>
            ]
        };



        let extentsConfig = [];
        if(ckeId && showEdit){
            let {
                atList, curUserid
            } = toJS(this.props.blogMyBlog.status);


            extentsConfig = [{
                name: "At",
                request: {
                    url:"/api/blog/at/getAtAllList",
                    type:"GET",
                }
            }];

        }

        const datas = [];
        ecmeEditButtons.map((item,key) =>{
            let it ={};
            let text=  '内容'+key+' '+item.dateandtime;

            datas.push(<MenuItem ecId={`${this && this.props && this.props.ecId || ''}_MenuItem@qk1qwf@${key}`}>
                <span  style={{"color": "#484848"}} onClick={() => this.duoBlogEcmeEditOpen(item.id,item.partid)}>{text}</span>
            </MenuItem>);

        })

        if(this.state.partids!=undefined){
            partid = this.state.partids;
        }

        if(ecmeEditButtons.length==1){
            partid=ecmeEditButtons[0].partid;
        }

        const WeaCircleImageSty={
            margin: "0 6px 0 10px",
            position: "absolute",
            display: (hasImage ? "inline-block" : "none")
        };

        const style1 = {marginLeft: (hasImage ? "56px" : "0")};
        const style2 = {marginTop: (!hasImage ? "-10px" : "0")};

        const specialSty = {"color":"#f16c0f"};
        const privateSty = {"color":"#0066ff"};
        const fwSty ={"color":"#0066ff","cursor": "pointer"};
        const paddSty={padding: (!hasImage ? "0 12px 0 12px" : "0")}
        const positionSty={margin: "15px 0 0 10px", fontSize: "14px"}
        const positionSty1 = {marginRight: "4px"}

        const dropDownSty ={ padding: 0, background: 'transparent', border: 'none', color: '#dadada', fontSize: 12 };
        const dropDwonSty1 ={"right":" 7px","top": "-3px","background-color":"transparent","border":"0","color":"#484848"};
        const editSty={"color":"#484848"};

        const iscancomSty = (commenting ? {color: "#32a8ff", cursor: "default"} : {
            color: "#484848",
            cursor: "pointer"
        })

        const ckSty={
            lineHeight: '28px',
            fontSize: '16px',
            verticalAlign: 'top',
            marginLeft: '4px',
            fontWeight: 'normal'
        }

        const showDivSty = {display: (editing ? "none" : "")};
        //暂时接入过来 zxt
        return (
            <div>
                <div
                    style={showDivSty}
                    className={'wea-mbw-container wea-mbw-container-' + (isLast ? 'last' : 'other')}
                    onMouseEnter={this.onMouseEnter}
                    onMouseLeave={this.onMouseLeave}
                >
                    {
                        isPermissions==0?"":
                            isManagerScore ? (
                                score ? (
                                    isMeCanScored ? (
                                        <WeaRate ecId={`${this && this.props && this.props.ecId || ''}_WeaRate@y6rn2i`}
                                            className="wea-mbwc-score"
                                            value={score}
                                            onChange={this.onScoreChange}
                                        />
                                    ) : (
                                        <WeaRate ecId={`${this && this.props && this.props.ecId || ''}_WeaRate@t3terc`}
                                            className="wea-mbwc-score"
                                            value={score}
                                            disabled={true}
                                        />
                                    )
                                ) : (
                                    showScore ? (
                                        isMeCanScored ? (
                                            <WeaRate ecId={`${this && this.props && this.props.ecId || ''}_WeaRate@2ykafc`}
                                                className="wea-mbwc-score"
                                                value={score}
                                                onChange={this.onScoreChange}
                                            />
                                        ) : (
                                            <WeaRate ecId={`${this && this.props && this.props.ecId || ''}_WeaRate@4prcsb`}
                                                className="wea-mbwc-score"
                                                value={score}
                                                disabled={true}
                                            />
                                        )
                                    ) : null
                                )
                            ) : null
                    }
                    {
                        !hasScroll ? <Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@98j2mj`} title={replenishTitle} placement="leftBottom">
                            <div className="wea-mbwc-type"><WeaAnnularIcon ecId={`${this && this.props && this.props.ecId || ''}_WeaAnnularIcon@i46dqb`} {...typeIcon[type]}/></div>
                        </Tooltip> : null
                    }
                    <WeaCircleImage ecId={`${this && this.props && this.props.ecId || ''}_WeaCircleImage@lws7wz`}
                        name={user.name}
                        diameter={40}
                        src={user.src}
                        style={WeaCircleImageSty}
                    />

                    {!showEdit ?
                        <div style={style1}>
                            <div className="wea-mbwc-top" style={style2}>
                            <span
                                className="wea-mbwct-item wea-mbwct-name"
                                onClick={() => window.open(innerHref.blog(user.id))}
                            >
                                {user.name || ""}
                               </span>

                                {specialStatus==0?"": <span className=" wea-mbwct-item wea-mbwct-mood icon-coms02-icon-Special-concern" title={getLabel(514285,'特别关注')} style={specialSty} />}
                                {isPermissions==0?"": <span
                                    className={'wea-mbwct-item wea-mbwct-mood ' + (mood ? (mood.itemName == Moods.happy ? "icon-blog-Emoji" : (mood.itemName == Moods.sad ? "icon-blog-Unhappy" : "")) : "")}
                                />}

                                {shareType==2? <span className=" wea-mbwct-item wea-mbwct-mood icon-coms02-locking-o"  title={getLabel(83281,'私密')} style={privateSty}  />:""}
                                {shareType==3||shareType==4? <span className=" wea-mbwct-item wea-mbwct-mood icon-coms-HumanResources" title={showTT} onClick={this.onClickOpenShare} style={fwSty} />:""}

                                {
                                    isShowReadOrUnread ? (
                                        !isReaded ? (
                                            <span className="wea-mbwct-item wea-mbwct-readed icon-blog-NewMessage"/>
                                        ) : ""
                                    ) : ""
                                }
                                {
                                    authority == Authority.one ? (
                                        <div className="wea-mbwct-item">
                                            <span className="authority-item authority-one">{getLabel(83281, "私密")}</span>
                                        </div>
                                    ) : (
                                        authority == Authority.many ? (
                                            <div className="wea-mbwct-item">
                                            <span
                                                className="authority-item authority-many icon-blog-VisiblePart"
                                                onClick={() => this.setModalPublicViewVisible(true)}
                                            >&nbsp;{getLabel(384396, "部分公开")}</span>
                                            </div>
                                        ) : ''
                                    )
                                }
                            </div>

                            <div style={paddSty}>

                                {Children.only(children)}
                                { isPermissions==0?"":        <div>
                                    {isHasLocation == '1' ?
                                        <div style={positionSty}>
                                            <a onClick={this.openMap}><span className="icon-coms-position"
                                                                            style={positionSty1}/>{getLabel(384395, "查看地图")}</a>
                                        </div> : undefined
                                    }
                                    <div className="wea-mbwc-bottom">
                            <span
                                className="wea-mbwcb-item wea-mbwcb-left">{DateFormat(dateLocal, "yyyy" + getLabel(383372, '年') + "MM" + getLabel(383373, '月') + "dd" + getLabel(383374, '日') + " HH:mm:ss")}</span>
                                        <div className="wea-mbwcb-item wea-mbwcb-right">
                                            {
                                                isUnSumitRemind ? (
                                                    <span
                                                        className="wea-mbwcbr-item wea-f14  icon-blog-remind"
                                                        onClick={this.onRemindClick}
                                                    ><span
                                                        className="wea-f12">{this.state.isRemind ? getLabel(27085, "已提醒") : getLabel(15148, "提醒")}</span></span>
                                                ) : ""
                                            }
                                            {
                                                oneSubmit!="1" ? ( isCanReplenish ? (
                                                    <span
                                                        className="wea-mbwcbr-item wea-f14  icon-blog-edit"
                                                        onClick={() => this.onBuJiaoClick()}
                                                    ><span className="wea-f12">&nbsp;{getLabel(26927, "补交")}</span></span>
                                                ) : ""):""
                                               
                                            }

                                            {
                                                oneSubmit!="1" ?(
                                                    isCanEdit && datas.length>1 ? ( <WeaDropdown ecId={`${this && this.props && this.props.ecId || ''}_WeaDropdown@0ypq4n`} style={dropDwonSty1}
                                                                                                 type='small'
                                                                                                 icon={<Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@m6svsg`}/>}
                                                                                                 overlay={<Menu ecId={`${this && this.props && this.props.ecId || ''}_Menu@076byi`}>{datas}</Menu>}
                                                                                                 btnProps={{
                                                                                                     style: dropDownSty
                                                                                                 }}
                                                                                                 trigger={['click']}
                                                    ><span className="icon-blog-edit" style={editSty}>&nbsp;{getLabel(26473, "编辑")}</span></WeaDropdown>):""
                                                ):""
                                            }
                                            {
                                                oneSubmit!="1" ? (
                                                    isCanEdit && datas.length==1? (<span
                                                        className="wea-mbwcbr-item wea-f14  icon-blog-edit"
                                                        onClick={() => this.onEditRichClick()}
                                                    ><span className="wea-f12">&nbsp;{getLabel(26473, "编辑")}</span></span>):""
                                                ):""
                                            }
                                            {
                                                oneSubmit!="1" ?( isCanEdit &&datas.length==0? (
                                                    <span
                                                        className="wea-mbwcbr-item wea-f14  icon-blog-edit"
                                                        onClick={() => this.onEditClick(ckeId + "_edit", content)}
                                                    ><span className="wea-f12">&nbsp;{getLabel(26473, "编辑")}</span></span>
                                                ) : ""):""
                                               
                                            }{!isCanCom?( <span
                                            className="wea-mbwcbr-item wea-f14  icon-blog-Comment"
                                            onClick={this.onCommentClick.bind(this, ckeId + "_comment")}
                                            style={iscancomSty}
                                        ><span className="wea-f12">&nbsp;{getLabel(675, "评论")}</span></span>):""}
                                            {
                                                isCanZan ? (
                                                    <span
                                                        className="wea-mbwcbr-item wea-f14  icon-blog-Good"
                                                        style={{color: isAgree ? "#32a8ff" : "#484848"}}
                                                        onClick={this.onAgreeClick}
                                                    ><span className="wea-f12">&nbsp;{getLabel(384393, "点赞")}</span></span>
                                                ) : ''
                                            }
                                            {
                                                isShowLog ? (
                                                    <span
                                                        className={'wea-mbwcbr-item wea-f14  icon-blog-' + (showWorkRecord ? 'up' : 'down')}
                                                        onClick={ () =>  {
                                                            this.setState({showWorkRecord: !showWorkRecord,isSpread:0})
                                                        }}
                                                    ><span className="wea-f12">&nbsp;{getLabel(83172, "系统工作记录")}</span></span>
                                                ) : ""
                                            }

                                            {
                                                content && (
                                                    <span
                                                        className={'wea-mbwcbr-item wea-f14 icon-coms-form-copy'}
                                                        onClick={() => this.copyToClipboard(blogId)}
                                                    ><span className="wea-f12">&nbsp;{getLabel(77, "复制")}</span></span>
                                                )
                                            }



                                        </div>
                                    </div>
                                    <AgreeContainer ecId={`${this && this.props && this.props.ecId || ''}_AgreeContainer@cla0z8`}
                                        data={agrees}
                                        me={currentUser.id || ""}
                                        style={{margin: '10px 10px 0 10px'}}
                                    />
                                    <CommentList ecId={`${this && this.props && this.props.ecId || ''}_CommentList@1fvws6`}
                                        data={comments || []}
                                        blogId={blogId}
                                        blogMyBlog={blogMyBlog}
                                        user={user}
                                        blogType={blogType}
                                        hasEditor={hasEditor}
                                        weiboCKEditorConfig={weiboCKEditorConfig}
                                    />
                                    {
                                        showWorkRecord ? (
                                            <Tabs ecId={`${this && this.props && this.props.ecId || ''}_Tabs@ckx64t`} type="card" className="wea-nbwc-workRecord" animated={false}>
                                                {
                                                    workRecords.map(
                                                        (item, key) => {
                                                            return (
                                                                <TabPane ecId={`${this && this.props && this.props.ecId || ''}_TabPane@kzlyjx@${key}`}
                                                                    tab={item.name + ' ' + (item.count ? '(' + item.count + ')' : '')}
                                                                    key={key + 1}>
                                                                    <WorkRecordList ecId={`${this && this.props && this.props.ecId || ''}_WorkRecordList@18586n@${key}`} data={item.data || []}/>
                                                                </TabPane>
                                                            )
                                                        }
                                                    )
                                                }
                                            </Tabs>
                                        ) : null
                                    }
                                    {
                                        authority == Authority.many ? (
                                            <Modal ecId={`${this && this.props && this.props.ecId || ''}_Modal@chxqx5`}
                                                title={
                                                    <div>
                                                        <div className="icon-circle-base" style={{backgroundColor: '#6d3cf7'}}><span
                                                            className='icon-coms-blog'/></div>
                                                        <span
                                                            style={ckSty}
                                                        >&nbsp;
                                                            {getLabel(384394, "查看公开范围")}
                                        </span>
                                                    </div>
                                                }
                                                footer={
                                                    <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@e4sgxo`} key="back" type="ghost" size="large"
                                                            onClick={() => this.setModalPublicViewVisible(false)}
                                                    >{getLabel(31129, "取消")}</Button>
                                                }
                                                wrapClassName="wea-modal wea-vertical-center-modal wea-nopadding-modal"
                                                width="720"
                                                visible={this.state.modalPublicViewVisible}
                                                onOk={() => this.setModalPublicViewVisible(false)}
                                                onCancel={() => this.setModalPublicViewVisible(false)}
                                            >
                                                <Table ecId={`${this && this.props && this.props.ecId || ''}_Table@pfl061`}
                                                    className="wea-table wea-table-pagination-margin"
                                                    style={{height: '520px'}}
                                                    scroll={{x: true, y: 420}}
                                                    dataSource={publics}
                                                    pagination={{
                                                        total: publics.length,
                                                        showSizeChanger: true,
                                                        showQuickJumper: true,
                                                        showTotal: this.onPublicViewShowTotalChange,
                                                        onShowSizeChange: this.onPublicViewShowSizeChange,
                                                        onChange: this.onPublicViewChange
                                                    }}
                                                    columns={[
                                                        {
                                                            title: '类型',
                                                            dataIndex: 'type',
                                                            key: 'type',
                                                            width: 180,
                                                            className: "wea-table-column-padding"
                                                        },
                                                        {title: '条件内容', dataIndex: 'content', key: 'content', width: 420},
                                                        {title: '安全级别', dataIndex: 'level', key: 'level', width: 120}
                                                    ]}
                                                />
                                            </Modal>
                                        ) : ''
                                    }
                                    {
                                        ckeId && showComment ? (
                                            <div>
                                                <div className='wea-ckeditor-import-ecCom'
                                                     style={{padding: "12px 10px 0 10px", minHeight: ComVar.commentMinHeight + 64}}>
                                                    <WeaRichText ecId={`${this && this.props && this.props.ecId || ''}_WeaRichText@p1bjd7`}
                                                        id={ckeId + "_comment"}
                                                        ref={ckeId + "_comment"}
                                                        value={""}
                                                        ckConfig={{
                                                            toolbar: [
                                                                {name: 'document', items: ['Source']},
                                                                {
                                                                    name: 'paragraph',
                                                                    items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', '-', 'NumberedList', 'BulletedList']
                                                                },
                                                                {
                                                                    name: "clipboard",
                                                                    items: [
                                                                        "Cut",
                                                                        "Copy",
                                                                        "Paste",
                                                                        "PasteText",
                                                                        "PasteFromWord",
                                                                        "-",
                                                                        "Undo",
                                                                        "Redo"
                                                                    ]
                                                                },
                                                                {name: 'styles', items: ['Format', 'Font', 'FontSize']},
                                                                {name: 'colors', items: ['TextColor']},
                                                                {name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike',"-","CopyFormatting","RemoveFormat"]},
                                                                {name: 'insert', items: ['Image', 'Table', 'Smiley']},
                                                                { name: 'tools', items: [ 'Maximize' ] }
                                                            ],
                                                            extraPlugins: 'autogrow',
                                                            height: 100,
                                                            autoGrow_minHeight: ComVar.commentMinHeight,
                                                            autoGrow_maxHeight: 600,
                                                            removePlugins: 'resize',
                                                            uploadUrl: '/api/doc/upload/uploadFile',
                                                        }}
                                                        onToolsChange={Util.transfStr}
                                                    />
                                                </div>
                                                <CommentBar ecId={`${this && this.props && this.props.ecId || ''}_CommentBar@39wnd3`}
                                                    checked={this.state.isPrivate}
                                                    setPrivate={this.setPrivate}
                                                    submitComment={this.submitComment.bind(this, ckeId + "_comment")}
                                                    cancelComment={this.cancelComment.bind(this, ckeId + "_comment")}
                                                    style={{margin: "12px 12px 10px 12px", display: (commenting ? "" : "none")}}
                                                />
                                            </div>
                                        ) : <div/>
                                    }
                                </div> }
                            </div>
                        </div>
                        : ''}
                </div>
                {
                    ckeId && showEdit && partid==0 ? (
                        <div className='wea-ckeditor-import-ecCom'>
                            <div style={{minHeight: 251}}>
                                <WeaRichText ecId={`${this && this.props && this.props.ecId || ''}_WeaRichText@3tzfl6`}
                                    id={ckeId + "_edit"}
                                    ref={ckeId + "_edit"}
                                    value={content}
                                    ckConfig={{
                                        toolbar: [
                                            {name: 'document', items: ['Source']},
                                            {
                                                name: 'paragraph',
                                                items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', '-', 'NumberedList', 'BulletedList']
                                            },
                                            {
                                                name: "clipboard",
                                                items: [
                                                    "Cut",
                                                    "Copy",
                                                    "Paste",
                                                    "PasteText",
                                                    "PasteFromWord",
                                                    "-",
                                                    "Undo",
                                                    "Redo"
                                                ]
                                            },
                                            {name: 'styles', items: ['Format', 'Font', 'FontSize']},
                                            {name: 'colors', items: ['TextColor']},
                                            {name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike',"-","CopyFormatting","RemoveFormat"]},
                                            {name: 'insert', items: ['Image', 'Table', 'Smiley']},
                                            { name: 'tools', items: [ 'Maximize' ] }
                                        ],
                                        extraPlugins: 'autogrow',
                                        height: 150,
                                        autoGrow_minHeight: 150,
                                        autoGrow_maxHeight: 600,
                                        removePlugins: 'resize',
                                        uploadUrl: '/api/doc/upload/uploadFile',
                                    }}
                                    extentsConfig={extentsConfig}
                                    bottomBarConfig={bottomBarConfig}
                                    bottomBarRight={bottomBarRight}
                                    onToolsChange={Util.transfStr}
                                    onStatusChange={s =>  {this.setState({wearichtextstatus:s})}}
                                />
                            </div>
                        </div>
                    ) : <div/>
                }


                {
                    showEdit && partid > 0 ?
                        ( <div className="ecme_one">
                            <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@i01wdl`} tip="正在读取数据..." spinning={oneecmespinning}>
                            <div id="ecme_blogdiv" style={{"padding": "12px 17px 0px","min-height":"100px"}}>
                            {cubeFlags?(CubeLayout({cubeLayoutParame,"callback":this.initCallBack,"getCardStorefun":this.getCardStorefun})):""}
                            </div>
                            </Spin>
                                <div className="one_ecme_btn">
                                    <div className="one_ecme_leftbtn">
                                        <div className="wea-ecme-item">
                                            <Mood ecId={`${this && this.props && this.props.ecId || ''}_Mood@63jmke`}  ref={ckeId + '_ecme_mood'} mooddata={mood}/>
                                        </div>
                                        <div className="wea-ecme-item">
                                            <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@xwxbim`}
                                                customized={true}
                                                type={"blogTemplate"}
                                                title="模板"
                                                hasAdvanceSerach={true}
                                                isSingle={true}
                                                onChange={this.onTempletChange}
                                            >
                                                <span className='wea-cbi-icon icon-blog-Task'/>
                                                <span className="wea-cbi-text">  模板</span>
                                            </WeaBrowser>
                                        </div>
                                    </div>
                                    <div className="one_ecme_rightbtn">

                                        <span className="wea-rich-text-toolbar-bottom-item  ecmeshare" style={comsdownST}>
                    {viewShare}<span className='icon-coms-down' onClick={this.changeShowViewShare} style={{"font-size": "xx-small", "color":'#989a9c','margin-left':'10px',"cursor": "pointer"}}>
                    <WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@4dkvof@sharehelptip`}
                                   width =  {260} //如果要自定义宽度，在这里设置
                                   title={getLabel(525177,'微博没有真正意义上的"私密",上级和后端指定共享人为固定共享,不可修改."谁可以看"和"不给谁看"均为排除固定共享之后的筛选.') }
                                   isCenter={true}
                                   style={{'margin-left': '10px', 'top': '2px', 'position': 'relative'}}
                                   placement = 'bottom'
                    /></span>
                     <div className='viewShareAll' id={shareiid}>
                         <div className='viewshareitem'  style={bd1Color} onClick={this.changeviewShareType1}>
                             <div className='viewshareitemicon'>
                               {viewShareType=='1'?<i className="icon-coms-Upload-successfully-o"/>:<i className="icon-coms-Upload-successfully-o" style={{"visibility": "hidden"}}/>}
                             </div>
                              <div className='viewshareiteminfo'>
                                  <div className='viewshareitemtitle' style={{"font-size":"14px"}}>{getLabel(2161,'公开') }</div>
                                  <div className='viewshareitemtitleinfo' style={{'color':"#838181","font-size":"12px"}}>{getLabel(525178,'所有共享人可见') }</div>
                              </div>
                         </div>
              <div className='viewshareitem' style={bd2Color}  onClick={this.changeviewShareType2}>
                   <div className='viewshareitemicon'>
                       {viewShareType=='2'?<i className="icon-coms-Upload-successfully-o"/>:<i className="icon-coms-Upload-successfully-o" style={{"visibility": "hidden"}}/>}
                   </div>
                              <div className='viewshareiteminfo'>
                                  <div style={{"font-size":"14px"}}>{getLabel(83281,'私密') }</div>
                                  <div style={{'color':"#838181","font-size":"12px"}}>{getLabel(525179,'仅自己和固定共享人可见') }</div>
                              </div>
              </div>
              <div className='viewshareitem' style={bd3Color} >
                  <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@wtnl4c@blogAttentionUsers`}
                              type="17"
                              browserModalProps ={{parentClassName:"viewShareDialog"}}
                              textDecoration={true}
                              dataParams={{
                                  bdShare:"1"
                              }}
                              completeParams={{
                                  bdShare:"1"
                              }}
                              conditionDataParams={{
                                  bdShare:"1"
                              }}
                              viewAttr={3}
                              inputStyle={{ width: 232 }}
                              onChange={this.changeviewShareType3}
                              customized={true}
                              isSingle={false}
                              title={getLabel(521692,'谁可以看')}
                              icon="icon-coms-blog"
                  >
                    <div className='viewshareitemicon'>
                        {viewShareType=='3'?<i className="icon-coms-Upload-successfully-o"/>:<i className="icon-coms-Upload-successfully-o" style={{"visibility": "hidden"}}/>}
                    </div>
                    <div className='viewshareiteminfobrw'>
                       <div className='viewshareitemtitle' style={{"font-size":"14px"}}>{getLabel(521692,'谁可以看') }</div>
                       <div className='viewshareitemtitleinfo' style={{'color':"#838181","font-size":"12px"}}>{getLabel(525180,'指定共享人可见') }</div>
                    </div>
                  </WeaBrowser>
              </div>
              <div className='viewshareitem' style={bd4Color}>
                  <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@4j48wf@blogAttentionUsers`}
                              type="17"
                              browserModalProps ={{parentClassName:"viewShareDialog"}}
                              textDecoration={true}
                              dataParams={{
                                  bdShare:"1"
                              }}
                              completeParams={{
                                  bdShare:"1"
                              }}
                              conditionDataParams={{
                                  bdShare:"1"
                              }}
                              viewAttr={3}
                              inputStyle={{ width: 232 }}
                              onChange={this.changeviewShareType4}
                              customized={true}
                              isSingle={false}
                              title={getLabel(525176,'不给谁看') }
                              icon="icon-coms-blog"
                  >
                         <div className='viewshareitemicon'>
                             {viewShareType=='4'?<i className="icon-coms-Upload-successfully-o"/>:<i className="icon-coms-Upload-successfully-o" style={{"visibility": "hidden"}}/>}
                         </div>
                            <div className='viewshareiteminfobrw'>
                               <div className='viewshareitemtitle' style={{ "font-size":"14px"}}>{getLabel(525176,'不给谁看') }</div>
                               <div className='viewshareitemtitleinfo' style={{'color':"#838181","font-size":"12px"}}>{getLabel(525181,'指定共享人不可见') }</div>
                            </div>
                  </WeaBrowser>
              </div>
          </div>
                 </span>

                                    <span className="wea-rich-text-toolbar-bottom-item " style={{position: "relative", float: 'right',"padding":"10px 0 0 0"}}>
				<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@3jzw10`} disabled={isOk} className="wea-button-release" onClick={this.publishBlogEcme.bind(this, ckeId)}>
					<span><span className="icon-coms-Release"/><span>{getLabel(114, "发布")}</span></span>
				</Button>

				<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@jfkj9e`}  onClick={this.cancelEcmeOne} style={{marginLeft: '8px'}}>{getLabel(31129, "取消")}</Button>
			        </span>
                                    </div>
                                </div>
                        </div>
                        ) : ""
                }
                {isHasLocation == '1' ? <WeiboMapDialog ecId={`${this && this.props && this.props.ecId || ''}_WeiboMapDialog@7nrjjb`} ref="map" discussId={blogId}/>:"" }
            </div>
        )
    }


    onTempletChange(name, ids, list, type) {
        // Util.templetChange(this.refs[this.ckeId + "_edit"].getData(),v =>this.refs[this.ckeId + "_edit"].setData(v), name, ids, list, type)
        const {getEcmeTemlate,changePartId} = this.props.blogMyBlog;

        Modal.confirm({
            title: getLabel(505615,'替换当前内容？'),
            onOk: () => {
                if(list[0]&&(list[0].contentType==1||list[0].contentType=='1')){
                    this.setState({oneecmespinning:true})
                    getEcmeTemlate({templateId:list[0].id},result => {
                        changePartId(result.partid);
                        this.setState( {CubeLayoutParames:result.data,partids:result.partid});
                    })
                }else{
                    this.setState({partids:0,templateD:list[0].name})
                }
            },
            onCancel: () => {

            }
        });





    }

    copyToClipboard = (ckid,text) => {
   
      var textField= document.getElementById(ckid)
      document.execCommand("delete");
        if (document.body.createTextRange) {

          var range = document.body.createTextRange();
          range.moveToElementText(textField);
          range.select();
          message.success(getLabel(515358, "微博内容已复制到剪切板"));
      } else if (window.getSelection) {

          var selection = window.getSelection();
          var range = document.createRange();
          range.selectNodeContents(textField);
          selection.removeAllRanges();
          selection.addRange(range);
          message.success(getLabel(515358, "微博内容已复制到剪切板"));
         
      } else {
         console.log('none')
      }
        document.execCommand('copy')
    }

    onMouseEnter = () => {
        const {isMeCanScored, isShowReadOrUnread, isReaded} = this.props
        if (isMeCanScored) this.setState({showScore: true})
        if (isShowReadOrUnread && !isReaded) {
            const {setReaded, getBasicInfo} = this.props.blogMyBlog
            const {blogId, user, workdate, func} = this.props
            setReaded(
                {
                    blogId: user.id,
                    discussId: blogId,
                    workdate: workdate,
                    userId: user.id
                },
                result => {
                    if (result.status == "1") {
                        getBasicInfo()
                    }
                }
            )
        }
    }

    onMouseLeave = () => {
        const {isMeCanScored} = this.props
        if (isMeCanScored) this.setState({showScore: false})

    }

    onScoreChange = (value) => {
        let {func, blogId, workdate, user} = this.props
        const {setScore} = this.props.blogMyBlog

        setScore({
            discussId: blogId,
            score: value,
            workdate: workdate,
            userId: user.id
        })
    }

    onAuthType = (authType) => {
        this.setState({authType: authType})
    }

    onAuthRange = (authRange) => {
        this.setState({authRange: authRange})
    }

    onCommentClick = (ckeId) => {
        if (!this.state.commenting) {
            this.setState(
                {showComment: true, commenting: true}
            )
        }
    }

    setPrivate = (event) => {
        this.setState({isPrivate: event.target.checked})
    }

    submitComment = (ckeId) => {
        let ckref = this.refs[ckeId];
        if (this.refs[ckeId].wrappedInstance) {
            ckref = this.refs[ckeId].wrappedInstance
        } else {
            ckref = this.refs[ckeId]

        }
        if (!ckref.checkMode()) {
            message.error(getLabel('384536', "不能以源码模式或markdown模式保存，请将编辑器切换到可视化模式"));
            return;
        }
        let {func, blogId, blogType, user, workdate} = this.props
        let {editComment} = this.props.blogMyBlog

        let params = {
            content: this.refs[ckeId].getData() || '',
            bediscussantId: user.id,
            workdate: workdate,
            commentType: this.state.isPrivate ? 1 : 0,
            comefrom: ComeFrom.pc
        }
        if (this.refs[ckeId].wrappedInstance) {
            params = {
                content: this.refs[ckeId].wrappedInstance.getData() || '',
                bediscussantId: user.id,
                workdate: workdate,
                commentType: this.state.isPrivate ? 1 : 0,
                comefrom: ComeFrom.pc
            }
        }
        if (blogId) params.discussId = blogId
        editComment(
            params,
            {
                type: blogType,
                workdate: workdate,
                discussId: blogId,
                userId: user.id
            },
            result => {
                if (result.status == "1") {
                    if (this.refs[ckeId].wrappedInstance) {
                        this.refs[ckeId].wrappedInstance.removeEditor();

                    } else {
                        this.refs[ckeId].removeEditor();

                    }
                    this.setState({commenting: false, showComment: false, isPrivate: false})
                }
            }
        )
    }

    cancelComment = (ckeId) => {
        // this.refs[ckeId].removeEditor()
        if (this.refs[ckeId].wrappedInstance) {
            this.refs[ckeId].wrappedInstance.removeEditor();

        } else {
            this.refs[ckeId].removeEditor();

        }
        this.setState({commenting: false, showComment: false, isPrivate: false})
    }

    onAgreeClick = () => {
        let {func, blogId, blogType, currentUser, workdate, isAgree, user} = this.props
        let {editAgree} = this.props.blogMyBlog
        let params = {
            workdate: workdate,
            userId: currentUser.id,
            optType: isAgree ? 0 : 1
        }
        if (blogId) params.discussId = blogId
        editAgree(
            params,
            {
                type: blogType,
                workdate: workdate,
                discussId: blogId,
                userId: user.id
            }
        )
    }







    //打开建模 编辑窗口
    blogEcmeInfoOpen = () => {
        let {changeEcmeVisDiaLog,getBlogEcmeInfo,ecmeEditDialog,defaultCubeLayoutParame} = this.props.blogMyBlog;
        const {partid} = this.props;
        let workdate = DateFormat(this.props.workdate, "yyyy-MM-dd")
        changeEcmeVisDiaLog(true,workdate,this.props.blogId);
        if(partid==0){
            getBlogEcmeInfo({blogid:this.props.blogId,partid:defaultCubeLayoutParame.partid});
        }else{
            changeEcmeMood(this.props.mood);
            getBlogEcmeInfo({blogid:this.props.blogId,partid:partid});
        }

    }




    cancelWeibo = (ckeId) => {
        const {changeReplaceDatas} = this.props.blogMyBlog;
        changeReplaceDatas([])

        if (this.refs[ckeId].wrappedInstance) {
            this.refs[ckeId].wrappedInstance.removeEditor();

        } else {
            this.refs[ckeId].removeEditor();
        }

        this.setState({editing: false, showEdit: false,noteworkdate:'',templateD:"",partids:undefined,viewShareType:this.props.shareType})

        if(!(window.location.href.indexOf('/user/')>0)){
            let {changeEdit} = this.props.blogMyBlog;
            changeEdit( {bqshowEdit: true, bqediting: true});
        }
    }



    cancelEcmeOne = () => {
        const {changeReplaceDatas} = this.props.blogMyBlog;
        changeReplaceDatas([])
        this.setState({editing: false, showEdit: false,noteworkdate:'',CubeLayoutParames:{},partids:undefined,oneecmespinning:true})
    }



    publishWeibo = (ckeId) => {
        let {editWeibo, getBasicInfo,changeReplaceDatas} = this.props.blogMyBlog
        let { blogId, blogType, user} = this.props,
            workdate = DateFormat(this.props.workdate, "yyyy-MM-dd")
        let ckref = this.refs[ckeId + '_edit'];

        if (this.refs[ckeId + '_edit'].wrappedInstance) {
            ckref = this.refs[ckeId + '_edit'].wrappedInstance;
        }
        if (!ckref.checkMode()) {
            message.error(getLabel('384536', "不能以源码模式或markdown模式保存，请将编辑器切换到可视化模式"));
            return;
        }
        this.setState({isOk:true})


        let richValue =this.refs[ckeId + '_edit'].getData()
        // 图片删除之后发布空微博问题
        let testV = richValue;
        testV = testV.replace(new RegExp(/(\n)/g),'')
        testV = testV.replace(/<p>|<\/p>/gi,"");

        if(testV==""){
            richValue = testV;
            Modal.warning({ title: getLabel(127354,"警告"), content: getLabel('126982',"请填写内容") });
            this.setState({isOk:false});
            return;
        }

        let params = {
            appItemId: (this.refs[ckeId + '_mood'] && this.refs[ckeId + '_mood'].getValue()) || "1",
            comefrom: ComeFrom.pc,
            content: richValue,
            workdate: workdate,
            shareType:this.state.viewShareType,
            shareValue:this.state.shareValue,
            atChooseId: this.refs[ckeId + '_edit'].getChooseId()
        }
        if (blogId) params.discussId = blogId;

        if(blogId==undefined){
            blogId="0";
        }
        editWeibo(
            params,
            {
                type: blogType,
                workdate: workdate,
                discussId: blogId,
                userId: user.id
            },
            result => {
                if (result.status == "1") {
                    getBasicInfo()
                    // this.refs[ckeId + '_edit'].removeEditor();
                    setTimeout(() => {
                        if(ckref.state.maximize==true){
                            ckref.onFullScreen();
                        }
                        this.setState({showEdit: false, editing: false,noteworkdate:"",isOk:false});
                        changeReplaceDatas([])
                        message.destroy();
                        message.success(getLabel('83885',"操作成功！"));
                    }, 1000)
                }else if(result.status == "2"){
            this.setState({isOk:false})
        }
            }
        )
    }

    onRemindClick = () => {
        if(this.state.isRemind){
            return;
        }
        let {user, workdate, func} = this.props;
        let {remind} = this.props.blogMyBlog
        let params = {workdate: workdate, remindId: user.id};
        remind(params, (result) => {
            this.setState({
                isRemind: true
            });
        });
    }

    onWorkRecordClick = () => {
        const {showWorkRecord} = this.state;
        this.setState({showWorkRecord: !showWorkRecord})

        let {func, blogId, blogType, workdate, user} = this.props
        let {getSystemWorkLog} = this.props.blogMyBlog

        if (!showWorkRecord) {
            getSystemWorkLog(
                {
                    workdate: workdate,
                    blogId: user.id
                },
                {
                    type: blogType,
                    workdate: workdate,
                    discussId: blogId,
                    userId: user.id,
                }
            )
        }
    }

    setModalPublicViewVisible = (modalPublicViewVisible) => {
        this.setState({modalPublicViewVisible: modalPublicViewVisible})
    }

    onPublicViewShowSizeChange = (current, pageSize) => {
    }
    onPublicViewChange = (current) => {

    }

    onPublicViewShowTotalChange = (total) => {
        return `共 ${total} 条`
    }
    openMap = () => {
        // this.refs.map.open();
        if (this.refs.map.wrappedInstance) {
            this.refs.map.wrappedInstance.open()
        } else {
            this.refs.map.open()
        }
    }
}

export default WeiboContainer



// WEBPACK FOOTER //
// ./../src4js/pc4mobx/blog/components/MyBlog/RightContainer/Weibo/WeiboContainer.js